#define _CRT_SECURE_NO_WARNINGS 1
#include"test.h"

const char* my_strstr(const char* str1, const char* str2)
{
	assert(str1 && str2);
	if (*str2 == 0)
		return str1;

	const char* s1 = nullptr;
	const char* s2 = nullptr;
	const char* check = str1;

	while (check)
	{
		s1 = check;
		s2 = str2;

		while (*s1 && *s2 && *s1 == *s2)
		{
			s1++;
			s2++;
		}
		if (*s2 == 0)
			return check;

		check++;
	}
	return nullptr;
}